package com.base.system.base.http.socket;

import cn.hutool.json.JSONUtil;
import com.base.system.bean.MsgInfo;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ServerEncoder implements Encoder.Text<MsgInfo> {
    @Override
    public String encode(MsgInfo msgInfo) throws EncodeException {
        return JSONUtil.toJsonPrettyStr(msgInfo);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
